enum Level {
    Error
}

struct Logger<'a>(&'a str, Level);

/// 在泛型上声明生命周期区间
fn configure_logger<T>(_t: T) where T: Send + 'static {
    // 此处配置logger
}

fn main() {
    let name1 = "Global";
    let log1 = Logger(name1, Level::Error);
    configure_logger(log1);

    // &name2 borrowed value does not live long enough
    let name2 = String::from("Local");
    let log2 = Logger(&name2, Level::Error);
    configure_logger(log2);
}